import React from "react"
import {HashRouter,Switch, BrowserRouter as Router, Route ,Redirect} from "react-router-dom";
import Sidebar from "../views/sidebar"
import Home1 from "../views/home"
import Nav from "../views/nav"
import Sign from "../views/sign"
import Demo from "../views/demo"
import User from "../views/user.js"
// 引入展示组件
import { About, Contact, Home, Products, Events, NotFound404, Details } from '../views/pages';

function router(){
    return (
            <Router>
                <Switch>
                    {/*<Route path='/' exact component={Home}/>*/}
                    <Route path='/about' component={About}/>
                    <Route path='/contact' component={Contact}/>
                    <Route path='/products' component={Products}/>
                    <Route path='/events' component={Events}/>
                    {/*<Redirect from='/history' to='about/history'></Redirect>*/}
                    <Route path='/details/:type' component={Details}></Route>
                    {/*<Route component={NotFound404}/>*/}


                    <Route path="/" component={Sign}  exact />
                    <Route path="/nav" component={Nav} />
                    <Route path="/sign" component={Sign} />
                    <Route path="/sidebar" component={Sidebar} />
                    <Route path="/demo" component={Demo} />
                    {/*<Route path="/sidebar/home" component={Home1} />*/}
                    {/*<Route path="/sidebar/user" component={User} />*/}
                    {/*<Route path="/sidebar"  render={()=>(*/}
                        {/*<Sidebar>*/}
                            {/*<Route path="/sidebar/home" component={Home1} />*/}
                            {/*<Route path="/sidebar/user" component={User} />*/}
                        {/*</Sidebar>*/}
                    {/*)}>*/}
                    {/*</Route>*/}

                    {/*<Redirect path="/" to="/home" />*/}
                </Switch>
        </Router>
            );
}
export default router;
